import java.util.Scanner;
public class DtoH {

	public static void main(String[] args) {		
	    Scanner sc=new Scanner(System.in);
	    System.out.println("input your number(0 for ending the program):");
	    int i=sc.nextInt();	
	    while(i!=0)
	    {	
	    	System.out.println(Integer.toHexString(i));
	    	i=sc.nextInt();	
	    }
	}
}
